﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Entidades="clr-namespace:BancoSim.Entidades.Entidades;assembly=BancoSim.Entidades" mc:Ignorable="d" x:Class="BancoSim.Ventanas_Modales.cwRegistrarServicio"
        Title="cwRegistrarServicio" Height="300" Width="300" Loaded="Window_Loaded">

    <Window.Resources>
        <CollectionViewSource x:Key="clServicioViewSource" d:DesignSource="{d:DesignInstance {x:Type Entidades:clServicio}, CreateList=True}"/>
        <CollectionViewSource x:Key="clGrupoViewSource" d:DesignSource="{d:DesignInstance {x:Type Entidades:clGrupo}, CreateList=True}"/>
    </Window.Resources>
    <Grid x:Name="grdRegistrarServicio" DataContext="{StaticResource clServicioViewSource}" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Label Content="Nombre Servicio:" Grid.Column="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center"/>
        <TextBox x:Name="nombreServicioTextBox" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="3" Text="{Binding NombreServicio, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" VerticalAlignment="Center" Width="150"/>
        </Grid>
        <Grid Grid.Row="1">
            <Button Name="btnGuardarServicio" Content="Guardar" Width="50" Click="btnGuardarServicio_Click"></Button>
        </Grid>
        <Grid Grid.Row="2" x:Name="gdGrupo" DataContext="{StaticResource clGrupoViewSource}">
            <ComboBox x:Name="clGrupoComboBox" DisplayMemberPath="NombreGrupo" ItemsSource="{Binding}" Margin="6" SelectedValuePath="NombreGrupo" SelectionChanged="clGrupoComboBox_SelectionChanged">
                <ComboBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel/>
                    </ItemsPanelTemplate>
                </ComboBox.ItemsPanel>
            </ComboBox>

        </Grid>
    </Grid>

</Window>
